<%@ taglib uri="/tld/extremecomponents" prefix="ec" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

	<script src = "../js/jquery-1.12.1.js" type = "text/javascript"></script>
	<script src = "../js/common.js" type = "text/javascript"></script>
	
	<link href="<%=request.getContextPath() %>/css/extremecomponents.css" rel="stylesheet" type="text/css" />
	<link href="<%=request.getContextPath() %>/css/global.css" rel="stylesheet" type="text/css" />
<title>Insert title here</title>
</head>
<script>

/*function stu_delete(student_id){
    formPost(window.SearchState, '','test?ActionType=test_StuDelete&STU_ID='+student_id, this);
};*/

function stu_delete(student_id){
	console.log(student_id);
		 var msg = "确定删除本学生成绩！"; 
		 if (confirm(msg)==true){ 
			 $.ajax({
		            type : "post",
		            dataType : "text",
		            url : "test?ActionType=test_StuDelete",
		            data : {"STU_ID":student_id},
		            success : function(massage) {
		                if (massage == 'success') {
		                	goTo("test?ActionType=test_ViewInit");
		                }else{
		                	alert("删除成绩信息失败！");
		                }
		            }
		        });
		 }else{ 
		   return false; 
		 } 
}

$(function() {
    //查询
    $("#btnsearch").click(
        function() {
            formPost(window.SearchState, '','test?ActionType=test_Select', this);
       
            });
    $("#btnadd").click(
    		function(){
    			formPost(window.SearchState,'','test?ActionType=test_AddInit&FLAG=add',this);
    		});
    
    });
</script>
<body>
<div id="current">当前位置：考试分析 &gt; 考试成绩管理</div>
<form name="SearchState" method="post">
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="search_table">
    <tr class="search_title_tr">
      <td colspan="5" class="search_title_L"><img src="../images/search_titleleft.jpg" width="84" height="30" align="top" /></td>
      <td width="25%" class="search_title_R"><img src="../images/search-titleright.jpg" width="8" height="30" align="top" /></td>
    </tr>
	
    <tr>
    <td width="12%" class="search_td1">学号：</td>
      <td width="25%" class="search_td2">
        <input name="STU_ID" type="text" size="16" value="<c:out value='${CONDITIONMAP.STU_ID}' />" />
      </td>
      <td width="12%" class="search_td1">姓名：</td>
      <td colspan="2" class="search_td2">
        <input name="STU_NAME" type="text" size="16" value="<c:out value='${CONDITIONMAP.STU_NAME}' />" />
      </td>
      
      <td class="search_td2">
      <input id="btnsearch" name="btnsearch" type="button" class="btn_2" value="查询" />
      <input id="btnadd" name="btnsearch" type="button" class="btn_2" value="添加成绩"/></td>
    
    </tr>
    
  </table>
  </form>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td class="search_shadow"></td>
    </tr>
    <tr>
        <td class="main_blank"></td>
    </tr>
</table>
<!--数据列表-START-->
<ec:table items="TESTINFO" var="row"
    action="test?ActionType=test_ViewInit"
    view="html" 
    autoIncludeParameters="false"
     >
    
    <ec:exportXls fileName="testList.xls" />
    <ec:row>
        <ec:column style="text-align:center;" width="7%" property="rowcount" cell="rowCount" title="序号" sortable="false"/>
        <ec:column property="student_id" style="text-align:center;" title="学号" />
        <ec:column property="student_name" style="text-align:center;" title="姓名" />
        <ec:column property="student_class" style="text-align:center;" title="班级" />
        <ec:column property="student_department" style="text-align:center;" title="学院" />
        <ec:column property="course_name" style="text-align:center;" title="科目" />
        <ec:column property="total_scores" style="text-align:center;" title="总成绩" />        
        <ec:column property="revise_scores" style="text-align:center;" title="修正成绩" />

        
        <ec:column property="isUpdate" style="text-align:center;" title="操作">
        <a href="#" onClick="formPost(window.SearchState,'','test?ActionType=test_UpdateInit&FLAG=update&STU_ID=<c:out value="${row.student_id}"/>',this);">修改</a> 
        | <a href="#" onClick="stu_delete('<c:out value="${row.student_id}"/>')">删除</a> 
        </ec:column>
      
    </ec:row>
</ec:table>

</body>
</html>